//
//  BaseViewController.m
//  BulgeFramework
//
//  Created by beisheng03 on 2018/2/23.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController



- (UITableView *)plainTableView{
    
    if (_plainTableView == nil) {
        
        UITableView *temp = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH) style:UITableViewStylePlain];
        
        temp.delegate = self;
        temp.dataSource = self;
        
        temp.showsVerticalScrollIndicator = NO;
        temp.showsHorizontalScrollIndicator = NO;
        
        temp.tableFooterView = [[UIView alloc]init];
        
        //        temp.estimatedRowHeight = 0;
        //        temp.estimatedSectionHeaderHeight = 0;
        //        temp.estimatedSectionFooterHeight = 0;
        _plainTableView = temp;
        
        [self.view addSubview:temp];
        
    }
    
    return _plainTableView;
    
    
}


- (UITableView *)groupTableView{
    
    if (_groupTableView == nil) {
        
        UITableView *temp = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH) style:UITableViewStyleGrouped];
        
        temp.delegate = self;
        temp.dataSource = self;
        
        temp.showsVerticalScrollIndicator = NO;
        temp.showsHorizontalScrollIndicator = NO;
        temp.tableFooterView = [[UIView alloc]init];
        
        _groupTableView = temp;
        
        
        [self.view addSubview:temp];
        
        
    }
    
    return  _groupTableView;
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = randomColor;
  
}


- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
//    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"push" style:UIBarButtonItemStylePlain target:self action:@selector(nextBtnDidTap)];
    
}


- (void)nextBtnDidTap{
    
    [self.navigationController pushViewController:[[BaseViewController alloc]init] animated:YES];
}

#pragma mark - tableviewDelegate

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 100;
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    return [[UITableViewCell alloc]init];
    
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSLog(@"------");
    
}


-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
    
    //    cell.layer.transform = CATransform3DMakeScale(0.1, 0.1, 1);
    //    //x和y的最终值为1
    //    [UIView animateWithDuration:0.25 animations:^{
    //        cell.layer.transform = CATransform3DMakeScale(1, 1, 1);
    //    }];
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (void)dealloc{
    
    
    [[NSNotificationCenter defaultCenter]removeObserver:self];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
